using Subfaculty.Common.Entities;
using Subfaculty.WebApplication.ViewModels;

namespace Subfaculty.WebApplication.Translators
{
	public class StudyAreaTranslator : BaseTranslator<StudyArea, StudyAreaViewModel>
	{
		public override StudyAreaViewModel Translate(StudyArea source)
		{
			var pe = new StudyAreaViewModel();

			pe.Id = source.Id;
			pe.Code = source.Code;
			pe.Name = source.Name;
			pe.Profile = source.Profile;
			pe.Qualification = source.Qualification;
			pe.Duration = source.Duration;

			return pe;
		}

		public override StudyArea TranslateBack(StudyAreaViewModel pe, StudyArea entity)
		{
			entity.Id = pe.Id;
			entity.Code = pe.Code;
			entity.Name = pe.Name;
			entity.Profile = pe.Profile;
			entity.Qualification = pe.Qualification;
			entity.Duration = pe.Duration;

			return entity;
		}

	}
}
